home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 149 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.6 KB

  1. Path: zetnet.co.uk!demon!polo!john
  2. From: john@polo.demon.co.uk (John Winters)
  3. Newsgroups: comp.std.c
  4. Subject: Re: ... char * * promotion to char const * const * ...
  5. Date: Fri, 19 Jan 1996 11:24:40 GMT
  6. Organization: Wallingford
  7. Message-ID: <DLFED5.70H@polo.demon.co.uk>
  8. References: <4dgj8q$qin@unix.sri.com> <KANZE.96Jan17121659@slsvewt.lts.sel.alcatel.de> <DLBzGB.J60@polo.demon.co.uk> <4dlrn5$81e@gabi.gabi-soft.fr>
  9. X-NNTP-Posting-Host: polo.demon.co.uk
  10.  
  11. In article <4dlrn5$81e@gabi.gabi-soft.fr>, J. Kanze <kanze@gabi-soft.fr> wrote:
  12. >John Winters (john@polo.demon.co.uk) wrote:
  13. >|> In article <KANZE.96Jan17121659@slsvewt.lts.sel.alcatel.de>,
  14. >|> James Kanze US/ESC 60/3/141 #40763 <kanze@lts.sel.alcatel.de> wrote:
  15. >|> [snip]
  16. >|> >
  17. >|> >Originally, the C standard was going to allow this; in fact, it was
  18. >|> >going to allow all casts which added const anywhere in the type.  Then
  19. >|> >someone pointed out that the conversion 'char ** -> char *const *' was
  20. >|> >unsafe.  As a result, the wording was changed to only allow adding the
  21. >|> >const at the top level.
  22. >
  23. >|> Interesting.  Could you enlighten us (well, me anyway) as to *why* it
  24. >|> is unsafe.  I don't find it immediately obvious.
  25. >
  26. >As another poster has already pointed out, I gave the wrong conversion
  27. >as unsafe.  (That's what comes of typing faster than you think.)
  28. >-- 
  29.  
  30. But that wasn't what caused me to be unable to understand.  Even with the
  31. correction I still couldn't see it without following the explanation
  32. very closely.  An amusing little hole - reminds me of group theory.
  33.  
  34. John
  35.  
  36. -- 
  37. John Winters.  Wallingford, Oxon, England.
  38.